bitkeeper revision 1.1569 (4296329bfi2iosJzMmIh7KglSdchjQ)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 26 May 2005 20:33:31 +0000 (20:33 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 26 May 2005 20:33:31 +0000 (20:33 +0000)
Clean up SMP bootstrap, and fix uniprocessor/APIC-less booting.
Signed-off-by: Keir Fraser <keir@xensource.com>
.rootkeys
xen/arch/x86/setup.c
xen/arch/x86/smpboot.c
xen/include/asm-x86/mach-default/smpboot_hooks.h [deleted file]

index e42f74c7ccbd59deb501e93b4d0893d09eabd7dd..7c30b7d9a584dca39d9283bba5fb8b64d305fba8 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 427fa2d093fDS2gOBLcl7Yndzl7HmA xen/include/asm-x86/mach-default/mach_ipi.h
 427fa2d0Y7bD35d-FvDAeiJDIdRw2A xen/include/asm-x86/mach-default/mach_mpparse.h
 427fa2d0OfglYyfpDTD5DII4M0uZRw xen/include/asm-x86/mach-default/mach_wakecpu.h
-427fa2d1EKnA8zCq2QLHiGOUqOgszg xen/include/asm-x86/mach-default/smpboot_hooks.h
 4294b5eeTwL8TeEI5pEzxvGD5obZsA xen/include/asm-x86/mach-es7000/mach_apic.h
 4294b5efhhBHJ81dsuLfJxWuN9PcDQ xen/include/asm-x86/mach-es7000/mach_apicdef.h
 4294b5efvb29X4mFAhUBdeGUPTFoBw xen/include/asm-x86/mach-es7000/mach_ipi.h
index 5c52b175c2a87b82525d75ab52e2a472719558a8..1a8ff629338f2ec6f9d6fe030c746713d4a80ca5 100644 (file)
@@ -211,6 +211,9 @@ static void __init start_of_day(void)
     for_each_cpu ( i )
         cpu_set(i, cpu_present_map);
 
+    /* Sanity: We ought to be taking interrupts by now. */
+    local_irq_enable();
+
     initialize_keytable();
 
     serial_init_stage2();
index b4a1ffb8943c4b7d085872a8b9ad40b56a3a714b..9249b88117a279195a11fd9ffa3723cec596e7a6 100644 (file)
@@ -47,7 +47,6 @@
 #include <asm/msr.h>
 #include <mach_apic.h>
 #include <mach_wakecpu.h>
-#include <smpboot_hooks.h>
 
 static int _foo;
 #define set_kernel_exec(x,y) (_foo=0)
@@ -803,7 +802,13 @@ static int __init do_boot_cpu(int apicid)
 
        store_NMI_vector(&nmi_high, &nmi_low);
 
-       smpboot_setup_warm_reset_vector(start_eip);
+       CMOS_WRITE(0xa, 0xf);
+       local_flush_tlb();
+       Dprintk("1.\n");
+       *((volatile unsigned short *) TRAMPOLINE_HIGH) = start_eip >> 4;
+       Dprintk("2.\n");
+       *((volatile unsigned short *) TRAMPOLINE_LOW) = start_eip & 0xf;
+       Dprintk("3.\n");
 
        /*
         * Starting actual IPI sequence...
@@ -947,7 +952,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
         */
        if (!smp_found_config && !acpi_lapic) {
                printk(KERN_NOTICE "SMP motherboard not detected.\n");
-               smpboot_clear_io_apic_irqs();
+       init_uniprocessor:
                phys_cpu_present_map = physid_mask_of_physid(0);
                if (APIC_init_uniprocessor())
                        printk(KERN_NOTICE "Local APIC not detected."
@@ -973,10 +978,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
        if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) && !cpu_has_apic) {
                printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
                        boot_cpu_physical_apicid);
-               printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
-               smpboot_clear_io_apic_irqs();
-               phys_cpu_present_map = physid_mask_of_physid(0);
-               return;
+               goto init_uniprocessor;
        }
 
        verify_local_APIC();
@@ -984,13 +986,8 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
        /*
         * If SMP should be disabled, then really disable it!
         */
-       if (!max_cpus) {
-               smp_found_config = 0;
-               printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n");
-               smpboot_clear_io_apic_irqs();
-               phys_cpu_present_map = physid_mask_of_physid(0);
-               return;
-       }
+       if (!max_cpus)
+               goto init_uniprocessor;
 
        connect_bsp_APIC();
        setup_local_APIC();
@@ -1030,9 +1027,17 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
        }
 
        /*
-        * Cleanup possible dangling ends...
+        * Install writable page 0 entry to set BIOS data area.
         */
-       smpboot_restore_warm_reset_vector();
+       local_flush_tlb();
+
+       /*
+        * Paranoid:  Set warm reset code and vector here back
+        * to default values.
+        */
+       CMOS_WRITE(0, 0xf);
+
+       *((volatile long *) phys_to_virt(0x467)) = 0;
 
 #ifdef BOGOMIPS
        /*
@@ -1103,7 +1108,12 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
        if (nmi_watchdog == NMI_LOCAL_APIC)
                check_nmi_watchdog();
 
-       smpboot_setup_io_apic();
+       /*
+        * Here we can be sure that there is an IO-APIC in the system. Let's
+        * go and set it up:
+        */
+       if (!skip_ioapic_setup && nr_ioapics)
+               setup_IO_APIC();
 
        setup_boot_APIC_clock();
 
diff --git a/xen/include/asm-x86/mach-default/smpboot_hooks.h b/xen/include/asm-x86/mach-default/smpboot_hooks.h
deleted file mode 100644 (file)
index 7f45f63..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
- * which needs to alter them. */
-
-static inline void smpboot_clear_io_apic_irqs(void)
-{
-       io_apic_irqs = 0;
-}
-
-static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
-{
-       CMOS_WRITE(0xa, 0xf);
-       local_flush_tlb();
-       Dprintk("1.\n");
-       *((volatile unsigned short *) TRAMPOLINE_HIGH) = start_eip >> 4;
-       Dprintk("2.\n");
-       *((volatile unsigned short *) TRAMPOLINE_LOW) = start_eip & 0xf;
-       Dprintk("3.\n");
-}
-
-static inline void smpboot_restore_warm_reset_vector(void)
-{
-       /*
-        * Install writable page 0 entry to set BIOS data area.
-        */
-       local_flush_tlb();
-
-       /*
-        * Paranoid:  Set warm reset code and vector here back
-        * to default values.
-        */
-       CMOS_WRITE(0, 0xf);
-
-       *((volatile long *) phys_to_virt(0x467)) = 0;
-}
-
-static inline void smpboot_setup_io_apic(void)
-{
-       /*
-        * Here we can be sure that there is an IO-APIC in the system. Let's
-        * go and set it up:
-        */
-       if (!skip_ioapic_setup && nr_ioapics)
-               setup_IO_APIC();
-}